/******************************************************************* * * * Docsearch.awebrx * * * * © 1997 Yvon Rozijn * * * * Search in AWeb documentation. Generate index if requested or * * no index file exists yet. Search the index file and pass * * results on to AWeb. * * * *******************************************************************/ /******************************************************************* * * * To use this as a search engine for your own set of local HTML * * files, adjust the following variables: * * * * index = path of index file */ index = 'AWebPAth:docs/docsearch.index' /* makeindex = full command line to make the index. * * The makeindex program takes template: DIR/A/M,TO/A * * DIR = directories to search for #?.html files (not recursive) * * TO = name of index file to create */ makeindex = 'AWebPath:docs/makeindex AWebPath:docs AWebPath:docs/plugins AWebPath:docs/settings AWebPath:docs/arexx' index /* resultfile = path of file to store search result */ resultfile = 'T:docsearch' /* searchindex = full command line to search the index, the search * * argument will be appended. * * The searchindex program takes template: INDEX/A,TO/A,SEARCH/A/F * * INDEX = path of index file * * TO = path of search result * * SEARCH = string to search */ searchindex = 'AWebPath:docs/searchindex' index resultfile /* and adjust the HTML used in the search result to fit your * * application. * * * *******************************************************************/ options results options failat 20 parse source dummy1 dummy2 programname . parse arg sarg search='' regenerate='' interpret sarg if search='' & regenerate='' then exit su=upper(search) nl='0a'x if regenerate~='' | ~exists(index) then do 'chanopen "x-nil:docsearch/creating index"' ch=result 'open "x-nil:docsearch/creating index"' 'chanheader' ch '"content-type: text/html"' 'chanheader' ch '"pragma: no-cache"' doc='